import Mock from 'mockjs'
import {businessHours} from "./setting";

const turnoverInfo = {
  status:'success',
  data:{
    date:'@datetime("yyyy-MM-dd")',
    total:'@float(50000, 200000, 2, 2)',
    totalOrder:'@integer(50, 150)',
    perTransaction:'@float(1000, 10000, 2, 2)',
    orderedTurnover:'@float(50000, 200000, 2, 2)',
    chargeTurnover:'@float(50000, 200000, 2, 2)',
    detail: [
      { name: '现金', value: '50000.00' },
      { name: '银行卡', value: '60000.00' },
      { name: '微信', value: '30000.00' },
      { name: '支付宝', value: '60000.00' },
      { name: '现金会员卡', value: '@float(50000, 200000, 2, 2)' },
      { name: '功勋会员卡', value: '@float(50000, 200000, 2, 2)' },
      { name: '现金挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
      { name: '银行卡挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
      { name: '微信挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
      { name: '支付宝挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
      { name: '订台押金', value: '@float(50000, 200000, 2, 2)' },
      { name: '竞拍订金', value: '@float(50000, 200000, 2, 2)' }
    ]
  }
}

const revenueInfo = {
  status:'success',
  data:{
    date:'@datetime("yyyy-MM-dd")',
    total:'@float(50000, 200000, 2, 2)',
    detail: [
      { name: '现金', value: '50000.00' },
      { name: '银行卡', value: '60000.00' },
      { name: '微信', value: '30000.00' },
      { name: '支付宝', value: '60000.00' },
      { name: '现金会员卡', value: '@float(50000, 200000, 2, 2)' },
      { name: '功勋会员卡', value: '@float(50000, 200000, 2, 2)' },
      { name: '现金挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
      { name: '银行卡挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
      { name: '微信挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
      { name: '支付宝挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
      { name: '订台押金', value: '@float(50000, 200000, 2, 2)' },
      { name: '竞拍订金', value: '@float(50000, 200000, 2, 2)' }
    ]
  }
}

const openStatusList = {
  status:'success',
  'data|5':[
    {
      'AREA|1':['大厅区','吧台区','包厢区'],
      'ROOM_PLATFORM_TYPE|1': ['散台','卡座','高卡','包厢'],
      total:'@integer(1, 20)',
      opened:'@integer(1, 35)'
    }
  ]
}

const areaTimeTurnover = {
  status:'success',
  data:{
    areaTime:function () {
      var array = [],area = []
      for(var i = 0;i < 5;i++){
        area.push(Mock.mock({
          'AREA|1':['大厅区','吧台区','包厢区'],
          'ROOM_PLATFORM_TYPE|1': ['散台','卡座','高卡','包厢']
        }))
      }
      for(var i = Number(businessHours.data.open.split(":")[0]); i <= 23; i++){
        for(var j = 0; j < area.length; j++){
          array.push({
            AREA: area[j].AREA,
            ROOM_PLATFORM_TYPE: area[j].ROOM_PLATFORM_TYPE,
            time: (i < 10?'0' + i:i) + ':00',
            value: '@float(5000, 20000, 2, 2)'
          })
        }
      }
      for(var i = 0; i <= Number(businessHours.data.close.split(":")[0]); i++){
        for(var j = 0; j < area.length; j++){
          array.push({
            AREA: area[j].AREA,
            ROOM_PLATFORM_TYPE: area[j].ROOM_PLATFORM_TYPE,
            time: (i < 10?'0' + i:i) + ':00',
            value: '@float(5000, 20000, 2, 2)'
          })
        }
      }
      return Mock.mock(array)
    },
    timeDetail:function () {
      let obj = new Map()
      for(var i = Number(businessHours.data.open.split(":")[0]); i <= 23; i++){
        obj.set((i < 10?'0' + i:i) + ':00', Mock.mock([
          { name: '现金', value: '50000.00' },
          { name: '银行卡', value: '60000.00' },
          { name: '微信', value: '30000.00' },
          { name: '支付宝', value: '60000.00' },
          { name: '现金会员卡', value: '@float(50000, 200000, 2, 2)' },
          { name: '功勋会员卡', value: '@float(50000, 200000, 2, 2)' },
          { name: '现金挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
          { name: '银行卡挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
          { name: '微信挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
          { name: '支付宝挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
          { name: '订台押金', value: '@float(50000, 200000, 2, 2)' },
          { name: '竞拍订金', value: '@float(50000, 200000, 2, 2)' }
        ]))
      }
      for(var i = 0; i <= Number(businessHours.data.close.split(":")[0]); i++){
        obj.set((i < 10?'0' + i:i) + ':00', Mock.mock([
          { name: '现金', value: '50000.00' },
          { name: '银行卡', value: '60000.00' },
          { name: '微信', value: '30000.00' },
          { name: '支付宝', value: '60000.00' },
          { name: '现金会员卡', value: '@float(50000, 200000, 2, 2)' },
          { name: '功勋会员卡', value: '@float(50000, 200000, 2, 2)' },
          { name: '现金挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
          { name: '银行卡挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
          { name: '微信挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
          { name: '支付宝挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
          { name: '订台押金', value: '@float(50000, 200000, 2, 2)' },
          { name: '竞拍订金', value: '@float(50000, 200000, 2, 2)' }
        ]))
      }
      return Mock.mock(obj)
    }
  }
}

const areaMinChargeList = {
  status:'success',
  'data|15-50':[
    {
      'NUMBER|1':['A1台','B1台','C1台','M1台','A2台','B2台','C2台','M2台','A3台','B3台','C3台','M3台','1号房'],
      'AREA|1':['大厅区','吧台区','包厢区'],
      'ROOM_PLATFORM_TYPE|1': ['散台','卡座','高卡','包厢'],
      minCharge:'@float(50000, 200000, 2, 2)'
    }
  ]
}

const salesSummary = {
  status:'success',
  data:{
    date:'@datetime("yyyy-MM-dd")',
    total:'@float(50000, 200000, 2, 2)',
    turnover:'@float(1000, 10000, 2, 2)',
    presentTotal:'@float(50000, 200000, 2, 2)',
    salesNumber:'@integer(50, 150)',
    presentNumber:'@integer(20, 50)',
    'catagery|30-40': [
      {
        catageryName:'@ctitle()',
        total: '@float(50000, 200000, 2, 2)'
      }
    ],
    'detail|30-50': [
      {
        goodName:'@ctitle()',
        salesNumber:'@integer(50, 150)',
        presentNumber:'@integer(20, 50)',
        total: '@float(50000, 200000, 2, 2)'
      }
    ]
  }
}

const danceRevenue = {
  status:'success',
  data:{
    date:'@datetime("yyyy-MM-dd")',
    total:'@float(50000, 200000, 2, 2)',
    totalOrder:'@integer(50, 150)',
    perTransaction:'@float(1000, 10000, 2, 2)',
    detail: [
      { name: '现金', value: '50000.00' },
      { name: '银行卡', value: '60000.00' },
      { name: '微信', value: '30000.00' },
      { name: '支付宝', value: '60000.00' },
      { name: '现金会员卡', value: '@float(50000, 200000, 2, 2)' },
      { name: '功勋会员卡', value: '@float(50000, 200000, 2, 2)' },
      { name: '现金挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
      { name: '银行卡挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
      { name: '微信挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
      { name: '支付宝挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
      { name: '订台押金', value: '@float(50000, 200000, 2, 2)' },
      { name: '竞拍订金', value: '@float(50000, 200000, 2, 2)' }
    ]
  }
}

const cardRevenue = {
  status:'success',
  data:{
    date:'@datetime("yyyy-MM-dd")',
    total:'@float(50000, 200000, 2, 2)',
    applyRevenue:'@float(1000, 10000, 2, 2)',
    applyNum:'@integer(50, 150)',
    chargeRevenue:'@float(1000, 10000, 2, 2)',
    chargeNum:'@integer(50, 150)',
    'typeDetail|10-12': [
      {
        cardName:'@ctitle()',
        total: '@float(50000, 200000, 2, 2)',
        number:'@integer(10, 50)'
      }
    ],
    payMethodDetail: [
      { name: '现金', value: '50000.00' },
      { name: '银行卡', value: '60000.00' },
      { name: '微信', value: '30000.00' },
      { name: '支付宝', value: '60000.00' },
      { name: '现金会员卡', value: '@float(50000, 200000, 2, 2)' },
      { name: '功勋会员卡', value: '@float(50000, 200000, 2, 2)' },
      { name: '现金挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
      { name: '银行卡挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
      { name: '微信挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
      { name: '支付宝挂账（已收）', value: '@float(50000, 200000, 2, 2)' },
      { name: '订台押金', value: '@float(50000, 200000, 2, 2)' },
      { name: '竞拍订金', value: '@float(50000, 200000, 2, 2)' }
    ]
  }
}

const onAccountInfo = {
  status:'success',
  data:{
    date:'@datetime("yyyy-MM-dd")',
    total:'@float(50000, 200000, 2, 2)',
    goodTotal:'@float(50000, 200000, 2, 2)',
    goodNumber:'@integer(50, 150)',
    damagedTotal:'@float(1000, 10000, 2, 2)',
    damagedNumber:'@integer(20, 50)',
    memberCardTotal:'@float(1000, 10000, 2, 2)',
    memberCardNumber:'@integer(20, 50)'
  }
}

const presentStatisticsDetail = {
  status:'success',
  data:{
    date:'@datetime("yyyy-MM-dd")',
    total:'@float(50000, 200000, 2, 2)',
    number:'@integer(20, 50)',
    perTransaction:'@float(1000, 10000, 2, 2)',
    'detail|20-50':[
      {
        'NUMBER|1':['A1台','B1台','C1台','M1台','A2台','B2台','C2台','M2台','A3台','B3台','C3台','M3台','1号房'],
        'AREA|1':['大厅区','吧台区','包厢区'],
        'ROOM_PLATFORM_TYPE|1': ['散台','卡座','高卡','包厢'],
        PRESENTER: '@cname',
        'TYPE|1':[0,1,2,3,4],
        PRESENT_ID: '@string(32)'
      }
    ]
  }
}

const damagedInfo = {
  status:'success',
  data:{
    date:'@datetime("yyyy-MM-dd")',
    total:'@float(50000, 200000, 2, 2)',
    compensateTotal:'@float(1000, 10000, 2, 2)',
    compensateNumber:'@integer(20, 50)',
    maintainTotal:'@float(1000, 10000, 2, 2)',
    maintainNumber:'@integer(20, 50)',
    'detail|10-20':[
      {
        goodName:'@ctitle',
        number:'@integer(10, 50)',
        'type|1':[0,1],
        total: '@float(50000, 200000, 2, 2)'
      }
    ]
  }
}

const stockData = {
  status:'success',
  'data|5-20':[
    {
      name:'@cname',
      subscribeNum:'@integer(1, 20)',
      payedTotal: '@float(50000, 200000, 2, 2)',
      onAccountTotal: '@float(50000, 200000, 2, 2)',
      'notPayedOnAccountTotal|1': [0,'@float(20000, 100000, 2, 2)']
    }
  ]
}

export {turnoverInfo,revenueInfo,openStatusList,areaTimeTurnover,areaMinChargeList,salesSummary,danceRevenue,cardRevenue,onAccountInfo,presentStatisticsDetail,damagedInfo,stockData}
